<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <title>宝箱怪</title>
    <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="full-screen" content="true" />
    <meta name="screen-orientation" content="portrait" />
    <meta name="x5-fullscreen" content="true" />
    <meta name="360-fullscreen" content="true" />
    <style>
        html, body {
            -ms-touch-action: none;
            background: #000000;
            padding: 0;
            border: 0;
            margin: 0;
            height: 100%;
        }
    </style>
    <script src="config.js"></script>
    <script>
        var user_info = {
            'area': '新吴区',
            'auth_sign': '409d5c980303286149b32268e631e2a4',
            'channel': 'portal',
            'city': '无锡市',
            'citycode': '0510',
            'country': '中国',
            'device_info': 'Android,Redmi Note 4,6.0,Xiaomi',
            'district': '新吴区',
            'formatted_address': '江苏省无锡市新吴区震泽路靠近无锡(国家)软件园处女座',
            'headimgurl': 'http://imgser.yaotv.tvm.cn/2018-02-27/201802271707050055544663.jpg',
            'integral': 0,
            'ip': '172.16.58.6',
            'latitude': 31.489022,
            'longitude': 120.375046,
            'macaddress': 'c41f12e6370cf83b242eccf423f79d13',
            'mobile_number': '17315526405',
            'mtqsign': '86903086d5172aebe6034467e54808ae',
            'nickname': '三顾茅厕',
            'openid': 'oTA1CwLXmMa1rzE-1mu0wZWZl9EU',
            'province': '江苏省',
            'sex': 1,
            'sigExpire': '1507875886',
            'token': 'fc4c4fafb4c7ffc8501565000728840b',
            'ttdsbappid': 'wxd06496bae6bb4a78',
            'ttdsbwx_token': '46497107fa23',
            'ttopenid': 'orEt2t6q7NHo9WWRILkj-e59_goo',
            'tvmid': 'wxh58491927af119c3522ed1fdd',
            'unionid': 'oCLOAuLYpzaatnVCBDct-4_O3x1E',
            'user_address': '无锡市  新吴区',
            'version': '3.6.4',
            'wxTokenSig': 'a23b6e7ab8eb6b42fb3c3867cd456747',
            'yaoSig': '83a644255c767680f61fa91780f4955c'
        };
    </script>
</head>

<body>
    <div style="margin: auto;width: 100%;height: 100%;" class="egret-player"
         data-entry-class="Main"
         data-orientation="auto"
         data-scale-mode="fixedWidth"
         data-frame-rate="30"
         data-content-width="750"
         data-content-height="1334"
         data-multi-fingered="2"
         data-show-fps="false" data-show-log="false"
         data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
    </div>
<script>
    var tvm = {
        getUserInfo:function(){
            return new Promise(function(reslove,reject){
                reslove(user_info);
            });
        },
        closeH5:function(){
            console.log('closeH5');
        },
        jumpto:function(url){
            console.log('jumpto:'+url);
        }

    };

    var loadScript = function (list, callback) {
        var loaded = 0;
        var loadNext = function () {
            loadSingleScript(list[loaded], function () {
                loaded++;
                if (loaded >= list.length) {
                    callback();
                }
                else {
                    loadNext();
                }
            })
        };
        loadNext();
    };

    var loadSingleScript = function (src, callback) {
        var s = document.createElement('script');
        s.async = false;
        s.src = src;
        s.addEventListener('load', function () {
            s.parentNode.removeChild(s);
            s.removeEventListener('load', arguments.callee, false);
            callback();
        }, false);
        document.body.appendChild(s);
    };

    var xhr = new XMLHttpRequest();
    xhr.open('GET', config.staticurl + '/manifest.json?v=' + Math.random(), true);
    xhr.addEventListener("load", function () {
        var manifest = JSON.parse(xhr.response);
        var list = manifest.initial.concat(manifest.game);
        loadScript(list, function () {
            /**
             * {
             * "renderMode":, //Engine rendering mode, "canvas" or "webgl"
             * "audioType": 0 //Use the audio type, 0: default, 2: web audio, 3: audio
             * "antialias": //Whether the anti-aliasing is enabled in WebGL mode, true: on, false: off, defaults to false
             * "calculateCanvasScaleFactor": //a function return canvas scale factor
             * }
             **/
            egret.runEgret({ renderMode: "webgl", audioType: 0, calculateCanvasScaleFactor:function(context) {
                var backingStore = context.backingStorePixelRatio ||
                    context.webkitBackingStorePixelRatio ||
                    context.mozBackingStorePixelRatio ||
                    context.msBackingStorePixelRatio ||
                    context.oBackingStorePixelRatio ||
                    context.backingStorePixelRatio || 1;
                return (window.devicePixelRatio || 1) / backingStore;
            }});
        });
    });
    xhr.send(null);
</script>
</body>

</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>